Skip to content

Consolidate the Anchor v1 and shank examples onto LiteSVM 0.18.2 and solana-kite 0.7.0 - #219

Merged
mikemaccana merged 4 commits into
mainfrom
claude/litesvm-consolidate-0-18-2
Nov 25, 2026
Merged

mikemaccana merged 4 commits into
mainfrom
claude/litesvm-consolidate-0-18-2

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

The repository ran three LiteSVM versions and two solana-kite versions. This moves the
0.16.0 and 0.13.1 groups up, leaving one kite version everywhere and one LiteSVM version
per branch pair:

before after
litesvm 0.18.1 (35), 0.16.0 (58), 0.13.1 (1) 0.18.1 (35), 0.18.2 (59)
solana-kite 0.7.0 (58), 0.6.1 (56) 0.7.0 (114)

The remaining 35 move in #218,
which raises the 0.18.1 floor and drops the hand-written Agave pins. The two branches share
no files.

The upgrade is coupled: kite 0.6.1 requires litesvm ^0.16, so for the 56 crates that use
both, the two versions had to move together or resolution fails.

Audit, which should print one line each once #218 lands:

grep -rhoE 'litesvm[^=]*= *"[0-9.]+"' --include=Cargo.toml . | sort | uniq -c
grep -rhoE 'solana-kite[^=]*= *"[0-9.]+"' --include=Cargo.toml . | sort | uniq -c

solana-kite 0.6.1 → 0.7.0 needed no test changes. Comparing allow-list/anchor-v1 against
allow-list/anchor, which was already on 0.7.0, the solana_kite import blocks are identical:
create_wallet, send_transaction_from_instructions, the four token_extensions helpers and
transfer_hook::{build_hook_accounts, get_hook_accounts_address, HookAccount}.

Three things broke, all from crossing Agave 4.2 to 4.3

Every one of the 57 projects was built with cargo build-sbf and run with cargo test
against Agave 4.3.2. All 57 pass. Three needed a fix first, and none of the three was a
plain version bump.

basics/create-account — the rent rate moved

The test asserted the new account's lamports equalled Rent::default().minimum_balance(0),
a constant from anchor-lang's bundled solana-program, and got 650,240 where it expected
890,880. The program itself calls Rent::get(), so the runtime's rent sysvar is the only
value it can produce: LiteSVM 0.16.0 resolves solana-rent ~4.3.0 and 0.18.2 resolves
~4.4.0, whose default rate differs.

The test now reads the sysvar with svm.get_sysvar(), the same pattern the pyth test already
uses for Clock, so the expectation follows the runtime instead of a crate constant. That
needs the host-side solana_rent::Rent as a dev-dependency, because anchor-lang's own Rent
does not implement LiteSVM's GetSysvar — the split the pyth test comments on.

Note that solana-rent is on its own 4.4 line independently of the Agave 4.3.2 crates, so
"everything on 4.3" is not quite the right model: the small interface crates version
separately.

Four other tests use Rent::default(), but they use it to fund accounts rather than to
assert against what a program produced, so they are self-consistent and unaffected.

basics/transaction-v1 — a wincode major split, then a budget that was never big enough

The test calls wincode::serialize on a VersionedTransaction to get the exact wire bytes.
It asked for wincode 0.5 while LiteSVM 0.18.2 resolves solana-transaction's serializer at
0.6. Those are unrelated crates to the compiler, so VersionedTransaction implements 0.6's
SchemaWrite and not 0.5's, and the call did not compile. The v2 sibling already pairs the
same test with wincode 0.6.

With it compiling, three of its four tests failed on MaxLoadedAccountsDataSizeExceeded at
114,254 bytes against a 64 KiB limit. That limit counts the program's own account, and this
program's .so is 113,896 bytes on its own — the payer, the document account and the system
program add 358 between them. LiteSVM 0.16.0 did not charge the program account to the
transaction's budget and 0.18.x does.

This is also why the byte-identical v2 test still passes on a 64 KiB limit: that program
compiles to 18,880 bytes, six times smaller, and stays inside it. I checked the limit against
LiteSVM 0.18.1 as well as 0.18.2 — both report the same 114,254 bytes, so this is the 0.16 to
0.18 change rather than anything inside the 0.18 line.

The limit moves to 256 KiB and the comment now says what actually dominates it.

tools/shank-and-codama/native — the largest jump, and the only tracked lockfile

The plan expected 0.13.1 → 0.18.2 (Agave 4.0 → 4.3) to fight hardest, and to be dropped if it
did. It did not need to be.

This example tracks its own Cargo.lock, so bumping the manifest alone left the resolve where
it was. Regenerating it drops wincode 0.4.9 and 0.5.5 for a single 0.6.3. The test then stopped
compiling for two reasons:

  • svm.set_account takes the Account from solana-account 4.x and the dev-dependency asked
    for 3.x. Two majors of the same struct are unrelated types.
  • Transaction::new_signed_with_payer sits behind solana-transaction 4.x's wincode feature.
    The test had been reaching it through feature unification from the old LiteSVM, which 0.18.2
    no longer provides.

Its five host-side crates move to the versions the rest of the repository already pairs with
LiteSVM 0.18.x, so it stops being the outlier on all five.

Verification

Every project: cargo build-sbf on each program in the project, then cargo test. 57 of 57
pass.

Resolution was the thing being changed, so it was checked rather than assumed. Sampling across
project shapes, cargo tree -i litesvm reports 0.18.2 and cargo tree -i solana-program-runtime
reports 4.3.2 — with agave-feature-set v4.3.2 (available: v4.4.1) visible in the tree, which
is LiteSVM holding the Agave ceiling where it should. No crate reaches 4.4.x by a path LiteSVM
does not constrain.

One note for whoever runs these next: delete each project's untracked Cargo.lock before
re-resolving.
A stale lock makes cargo do a minimal update instead of a fresh resolve, and
when kite 0.6.1's wincode ^0.5 is already pinned in it, cargo keeps wincode 0.5.5 and then
picks solana-loader-v3-interface 8.0.1 to match rather than the 8.1.1 a clean resolve picks.
Two wincode majors in one graph, and the derive macro from one generates impls the other cannot
see. It fails as UpgradeableLoaderInstruction: wincode::serde::Serialize is not satisfied,
deep in a registry crate, and it is not a real breakage. Four projects reported it on the first
pass for exactly this reason and all four pass on a fresh lock.

Still unpinned upstream

litesvm 0.18.2 declares solana-loader-v3-interface ^8.0.1, a caret over a crate whose
wincode major changed within the range: 8.0.x wants wincode ^0.5.0 and 8.1.x wants
^0.6.0. A clean resolve takes 8.1.1 and unifies, so nothing is broken today, but the shape
is the same one that caused the Agave 4.4.0 breakage in
3134c69b:
an upstream caret wide enough to admit an incompatible combination, over projects that commit
no lockfile. Worth knowing about rather than pinning around for now.


Generated by Claude Code

The repository carried three LiteSVM versions: 0.18.1 in 35 crates,
0.16.0 in 58 Anchor v1 crates, and 0.13.1 in one native crate. It also
carried two solana-kite versions, 0.6.1 and 0.7.0. Nothing was broken by
this - LiteSVM 0.16.0 and 0.13.1 pin small Agave crates with `~` ranges,
which caps their graphs at the 4.2 and 4.0 lines, so neither could drift
to Agave 4.4. The spread was drift, not a defect.

Move the 58 Anchor v1 crates from LiteSVM 0.16.0 to 0.18.2 and the one
native crate from 0.13.1, which brings them from the Agave 4.2 and 4.0
lines onto 4.3, matching the rest of the repository.

litesvm and solana-kite have to move together: kite 0.6.1 requires
`litesvm ^0.16`, so bumping only one fails resolution. 57 crates move to
kite 0.7.0 alongside.

The kite upgrade needs no test changes. Comparing allow-list/anchor-v1
against allow-list/anchor, the `solana_kite` import blocks are identical
across 0.6.1 and 0.7.0 - `create_wallet`,
`send_transaction_from_instructions`, the four `token_extensions`
helpers, and `transfer_hook::{build_hook_accounts,
get_hook_accounts_address, HookAccount}`. The only difference between
those two files is that the v2 test sources LiteSVM, Keypair and Signer
from `anchor_v2_testing`, which is an Anchor-version artifact rather than
a kite one, so the v1 tests keep their direct imports.

Piloted on basics/transfer-sol/anchor-v1 before the bulk edit, since the
risk was anchor-lang 1.2.x colliding with LiteSVM 0.18.2's Agave 4.3
crates: it resolves to litesvm 0.18.2 with anchor-lang 1.2.2 and
solana-program-runtime 4.3.2, builds, and passes all three tests. Cargo
reports `agave-feature-set v4.3.2 (available: v4.4.1)`, which is LiteSVM
holding the Agave line that the hand-written `~4.3` pins used to hold.

Agave itself stays on 4.3.2. No LiteSVM release, tag or `master` targets
Agave 4.4, so 4.4 remains unreachable while the tests depend on LiteSVM.

Claude-Session: https://claude.ai/code/session_01YTTjefTz2Kbj8t5qg77kXg
The test asserted the created account's lamports equalled
`Rent::default().minimum_balance(0)`, a constant from anchor-lang's
bundled solana-program. The program under test calls `Rent::get()`, so
the runtime's rent sysvar is the only value it can produce, and the two
diverged: LiteSVM 0.16.0 resolves solana-rent ~4.3.0 while 0.18.2
resolves ~4.4.0, whose default rate gives 650240 lamports for a 0-data
account rather than 890880.

Read the sysvar instead, so the expectation follows the runtime. This
needs the host-side `solana_rent::Rent`, because anchor-lang's own
`Rent` does not implement LiteSVM's GetSysvar - the same split the pyth
tests note for Clock.

Verified by attribution rather than assumption: the test passes on main
with litesvm 0.16.0 in a separate worktree, and failed only under the
bump, so this is drift surfaced by the version move rather than a
regression in the examples.

Claude-Session: https://claude.ai/code/session_01YTTjefTz2Kbj8t5qg77kXg
The litesvm bump from 0.13.1 landed in the manifest but not in the
lockfile, which this example tracks, so the resolve never moved. The
lockfile is regenerated here; it drops wincode 0.4.9 and 0.5.5 for a
single 0.6.3, the version litesvm 0.18.2 serializes with.

With the resolve actually at 0.18.2 the test stopped compiling, for two
reasons a version bump alone does not show:

  * `svm.set_account` takes the `Account` from solana-account 4.x, and
    the dev-dependency asked for 3.x. Two majors of the same struct are
    unrelated types to the compiler.
  * `Transaction::new_signed_with_payer` sits behind solana-transaction
    4.x's `wincode` feature. The test had been reaching it through
    feature unification from the old litesvm, which 0.18.2 no longer
    provides.

So the five host-side SDK crates move to the versions the rest of the
repository already pairs with litesvm 0.18.x - solana-account 4.3.0,
solana-pubkey 4.3, solana-transaction 4.2, solana-instruction 3.0.0,
solana-keypair 3.0.1 - and a comment records why the majors are not
interchangeable.

All five tests pass: the rental lifecycle suite and the client's own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YTTjefTz2Kbj8t5qg77kXg
Two separate breakages, both uncovered by the move to LiteSVM 0.18.2.

The test calls `wincode::serialize` on a `VersionedTransaction` to get
the exact wire bytes, and asked for wincode 0.5 while LiteSVM 0.18.2
resolves solana-transaction's serializer at 0.6. The two are unrelated
crates to the compiler, so `VersionedTransaction` implements 0.6's
`SchemaWrite` and not 0.5's, and the call did not compile. The v2
sibling already pairs the same test with wincode 0.6. The other version
pins here move to the ones the rest of the repository uses with LiteSVM
0.18.x, so this example stops being the outlier on four crates.

With it compiling, three of the four tests failed on
`MaxLoadedAccountsDataSizeExceeded` at 114,254 bytes against a 64 KiB
limit. The limit counts the program's own account, and this program's
`.so` is 113,896 bytes on its own - the payer, the document account and
the system program add 358. LiteSVM 0.16.0 did not charge the program
account to the transaction's budget and 0.18.x does, which is why this
only surfaced now, and why the byte-identical v2 test still passes: that
program compiles to 18,880 bytes, comfortably inside 64 KiB.

So the limit moves to 256 KiB and the comment says what actually
dominates it, rather than claiming the four accounts together stay well
under 64 KiB. Verified against LiteSVM 0.18.1 as well as 0.18.2: both
report the same 114,254 bytes, so this is the 0.16 to 0.18 change rather
than anything in the 0.18 line.

All four tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YTTjefTz2Kbj8t5qg77kXg
@mikemaccana
mikemaccana merged commit 5840cf3 into main Nov 25, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants